//
//  BaseNewsItemView.h
//  BaoVn
//
//  Created by Le Anh Tai on 11/8/14.
//  Copyright (c) 2014 Le Anh Tai. All rights reserved.
//

#import "BaseView.h"

@protocol LazyLoadingDelegate;
@interface BaseNewsItemView : BaseView
{
    BOOL _hideImage;
}

//UI
@property (nonatomic, assign) NSInteger marginLeft;
@property (nonatomic, assign) NSInteger marginRight;
@property (nonatomic, assign) NSInteger marginTop;
@property (nonatomic, assign) NSInteger marginBottom;
@property (nonatomic, assign) NSInteger paddingImageAndContent;

@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *descriptionLabel;
@property (nonatomic, strong) UILabel *createdDateLabel;
@property (nonatomic, strong) UIView *markedNewView;

//Delegate
@property (nonatomic, weak) id<LazyLoadingDelegate> delegateLazyLoading;

//data
@property (nonatomic, strong) NSManagedObject *data;

- (void)loadData:(NSManagedObject *)data;
- (void)hideImage;

@end

@protocol LazyLoadingDelegate <NSObject>

- (void)newsItemView:(BaseNewsItemView *)view didLoadImageWithError:(NSString *)error;

@end